﻿<UserControl x:Class="EX_NFC.FrontEnd.Windows.Controls.TagInfoControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="300">
    <UserControl.Resources>
        <!--Control Label Style-->
        <Style x:Key="TextBlockStyle1"
               TargetType="{x:Type TextBlock}">
            <Setter Property="SnapsToDevicePixels"
                    Value="true" />
            <Setter Property="Foreground"
                    Value="{StaticResource LabelTextBrush}" />
            <Setter Property="FontFamily"
                    Value="{StaticResource ContentFontFamily}" />
            <Setter Property="FontSize"
                    Value="{DynamicResource LabelFontSize}" />
            <Setter Property="TextOptions.TextHintingMode"
                    Value="Animated" />
            <Setter Property="HorizontalAlignment"
                    Value="Right" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="FontWeight"
                    Value="Bold" />
            <Setter Property="FontStyle"
                    Value="Normal" />
            <Setter Property="Margin"
                    Value="5" />
        </Style>
        <Style x:Key="TextBlockStyleDeviceInfo"
               TargetType="{x:Type TextBlock}">
            <Setter Property="SnapsToDevicePixels"
                    Value="true" />
            <Setter Property="Foreground"
                    Value="{StaticResource LabelTextBrush}" />
            <Setter Property="FontFamily"
                    Value="{StaticResource ContentFontFamily}" />
            <Setter Property="FontSize"
                    Value="{DynamicResource LabelFontSize}" />
            <Setter Property="TextOptions.TextHintingMode"
                    Value="Animated" />
            <Setter Property="HorizontalAlignment"
                    Value="Left" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="FontWeight"
                    Value="Normal" />
            <Setter Property="FontStyle"
                    Value="Italic" />
        </Style>

    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <!-- COLUMN 0 - 1 -->
        <TextBlock Grid.Row="0"
                   Grid.Column="0"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_TagType}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="0"
                   Grid.Column="1"
                   Text="{Binding TagName}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="0"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_TagManufacturer}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="1"
                   Text="{Binding Manufacturer}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <!-- COLUMN 2 - 3 -->
        <TextBlock Grid.Row="0"
                   Grid.Column="2"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_Capacity}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="0"
                   Grid.Column="3"
                   Text="{Binding Capacity}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="2"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_NumberOfSectors}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="3"
                   Text="{Binding NumberOfSectors}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <!-- COLUMN 4 - 5 -->
        <TextBlock Grid.Row="0"
                   Grid.Column="4"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_NumberOfKeys}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="0"
                   Grid.Column="5"
                   Text="{Binding NumberOfKeys}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="4"
                   Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_KeySize}"
                   Style="{DynamicResource TextBlockStyle1}" />
        <TextBlock Grid.Row="1"
                   Grid.Column="5"
                   Text="{Binding KeySize}"
                   Style="{DynamicResource TextBlockStyleDeviceInfo}" />
        <!-- COLUMN 6 -->
        <TextBlock  Grid.Column="6"
                    Grid.Row="0"
                    Text="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_SectorInfo}"
                    Style="{DynamicResource TextBlockStyle1}" />
        <ListView ItemsSource="{Binding BlocksInfo}"
     
                  Grid.Row="0"
                  Grid.RowSpan="3"
                  Grid.Column="7">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_StartSector}"
                                    DisplayMemberBinding="{Binding StartSector}" />
                    <GridViewColumn Header="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_EndSector}"
                                    DisplayMemberBinding="{Binding EndSector }" />
                    <GridViewColumn Header="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_NumberOfBlocksInSector}"
                                    DisplayMemberBinding="{Binding NumberOfBlocks}" />
                    <GridViewColumn Header="{Binding Source={StaticResource Localizer},Path=Localize.TagInfo_BlockSize}"
                                    DisplayMemberBinding="{Binding BlockCapacity}" />
                </GridView>
            </ListView.View>
        </ListView>
    </Grid>
</UserControl>
